﻿using Algorithms;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Collections;

namespace UnitTests
{
    
    
    /// <summary>
    ///This is a test class for TwoThreeTreeTest and is intended
    ///to contain all TwoThreeTreeTest Unit Tests
    ///</summary>
    [TestClass()]
    public class TwoThreeTreeTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for TwoThreeTree`1 Constructor
        ///</summary>
        public void TwoThreeTreeConstructorTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>();
            Assert.IsNotNull(target);
        }

        [TestMethod()]
        public void TwoThreeTreeConstructorTest()
        {
            TwoThreeTreeConstructorTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Add
        ///</summary>
        public void AddTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<char> tree = new TwoThreeTree<char>();

            List<char> list = new List<char>()
            {
               
            };


            Dictionary<char, string> map = new Dictionary<char, string>()
            {
                {'A', "d:0 v:A" },
                {'L', "d:0 v:(A-L)"},
                {'G', @"d:0 v:G
d:1 v:A
d:1 v:L"},
                {'O', @"d:0 v:G
d:1 v:A
d:1 v:(L-O)"},
                {'R', @"d:0 v:(G-O)
d:1 v:A
d:1 v:L
d:1 v:R"},
                {'I', @"d:0 v:(G-O)
d:1 v:A
d:1 v:(I-L)
d:1 v:R"},
                {'T', @"d:0 v:(G-O)
d:1 v:A
d:1 v:(I-L)
d:1 v:(R-T)"},
                {'H', @"d:0 v:I
d:1 v:G
d:1 v:O
d:2 v:A
d:2 v:H
d:2 v:L
d:2 v:(R-T)"},
                {'M', @"d:0 v:I
d:1 v:G
d:1 v:O
d:2 v:A
d:2 v:H
d:2 v:(L-M)
d:2 v:(R-T)"},
                {'S',@"d:0 v:I
d:1 v:G
d:1 v:(O-S)
d:2 v:A
d:2 v:H
d:2 v:(L-M)
d:2 v:R
d:2 v:T"}
            };

                foreach (KeyValuePair<char, string> pair in map)
                {
                    tree.Add(pair.Key);
                    Assert.AreEqual<string>(pair.Value, tree.ToString());
                }
            
            
        }

        [TestMethod()]
        public void AddTest()
        {
            AddTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Clear
        ///</summary>
        public void ClearTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            target.Clear();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void ClearTest()
        {
            ClearTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Contains
        ///</summary>
        public void ContainsTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            T value = default(T); // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.Contains(value);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void ContainsTest()
        {
            ContainsTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for CopyTo
        ///</summary>
        public void CopyToTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            T[] array = null; // TODO: Initialize to an appropriate value
            int arrayIndex = 0; // TODO: Initialize to an appropriate value
            target.CopyTo(array, arrayIndex);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void CopyToTest()
        {
            CopyToTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for FindNode
        ///</summary>
        public void FindNodeTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree_Accessor<T> target = new TwoThreeTree_Accessor<T>(); // TODO: Initialize to an appropriate value
            Node<T> node = null; // TODO: Initialize to an appropriate value
            T value = default(T); // TODO: Initialize to an appropriate value
            Node<T> expected = null; // TODO: Initialize to an appropriate value
            Node<T> actual;
            actual = target.FindNode(node, value);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        [DeploymentItem("Algorithms.exe")]
        public void FindNodeTest()
        {
            FindNodeTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for First
        ///</summary>
        public void FirstTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            T expected = default(T); // TODO: Initialize to an appropriate value
            T actual;
            actual = target.First();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void FirstTest()
        {
            FirstTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for GetEnumerator
        ///</summary>
        public void GetEnumeratorTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            IEnumerator<T> expected = null; // TODO: Initialize to an appropriate value
            IEnumerator<T> actual;
            actual = target.GetEnumerator();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void GetEnumeratorTest()
        {
            GetEnumeratorTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for GetList
        ///</summary>
        public void GetListTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree_Accessor<T> target = new TwoThreeTree_Accessor<T>(); // TODO: Initialize to an appropriate value
            IEnumerable<Node<T>> expected = null; // TODO: Initialize to an appropriate value
            IEnumerable<Node<T>> actual;
            actual = target.GetList();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        [DeploymentItem("Algorithms.exe")]
        public void GetListTest()
        {
            GetListTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for InOrderSearch
        ///</summary>
        public void InOrderSearchTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            Node<T> node = null; // TODO: Initialize to an appropriate value
            Action<T, string> func = null; // TODO: Initialize to an appropriate value
            target.InOrderSearch(node, func);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void InOrderSearchTest()
        {
            InOrderSearchTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Insert
        ///</summary>
        public void InsertTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree_Accessor<T> target = new TwoThreeTree_Accessor<T>(); // TODO: Initialize to an appropriate value
            T value = default(T); // TODO: Initialize to an appropriate value
            Node<T> node = null; // TODO: Initialize to an appropriate value
            Node<T> expected = null; // TODO: Initialize to an appropriate value
            Node<T> actual;
            actual = target.Insert(value, node);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        [DeploymentItem("Algorithms.exe")]
        public void InsertTest()
        {
            InsertTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Last
        ///</summary>
        public void LastTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            T expected = default(T); // TODO: Initialize to an appropriate value
            T actual;
            actual = target.Last();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void LastTest()
        {
            LastTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for PreOrder
        ///</summary>
        public void PreOrderTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            Node<T> node = null; // TODO: Initialize to an appropriate value
            Action<Node<T>> func = null; // TODO: Initialize to an appropriate value
            target.PreOrder(node, func);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void PreOrderTest()
        {
            PreOrderTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Predecessor
        ///</summary>
        public void PredecessorTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree_Accessor<T> target = new TwoThreeTree_Accessor<T>(); // TODO: Initialize to an appropriate value
            Node<T> node = null; // TODO: Initialize to an appropriate value
            T value = default(T); // TODO: Initialize to an appropriate value
            Node<T> expected = null; // TODO: Initialize to an appropriate value
            Node<T> actual;
            actual = target.Predecessor(node, value);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        [DeploymentItem("Algorithms.exe")]
        public void PredecessorTest()
        {
            PredecessorTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Remove
        ///</summary>
        public void RemoveTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            T value = default(T); // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.Remove(value);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void RemoveTest()
        {
            RemoveTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for RemoveAll
        ///</summary>
        public void RemoveAllTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            ICollection<T> c = null; // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.RemoveAll(c);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void RemoveAllTest()
        {
            RemoveAllTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for SplitNode
        ///</summary>
        public void SplitNodeTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree_Accessor<T> target = new TwoThreeTree_Accessor<T>(); // TODO: Initialize to an appropriate value
            Node<T> threeNode = null; // TODO: Initialize to an appropriate value
            T value = default(T); // TODO: Initialize to an appropriate value
            Node<T> expected = null; // TODO: Initialize to an appropriate value
            Node<T> actual;
            actual = target.SplitNode(threeNode, value);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        [DeploymentItem("Algorithms.exe")]
        public void SplitNodeTest()
        {
            SplitNodeTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Successor
        ///</summary>
        public void SuccessorTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree_Accessor<T> target = new TwoThreeTree_Accessor<T>(); // TODO: Initialize to an appropriate value
            Node<T> node = null; // TODO: Initialize to an appropriate value
            T value = default(T); // TODO: Initialize to an appropriate value
            Node<T> expected = null; // TODO: Initialize to an appropriate value
            Node<T> actual;
            actual = target.Successor(node, value);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        [DeploymentItem("Algorithms.exe")]
        public void SuccessorTest()
        {
            SuccessorTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for System.Collections.IEnumerable.GetEnumerator
        ///</summary>
        public void GetEnumeratorTest1Helper<T>()
            where T : IComparable
        {
            IEnumerable target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            IEnumerator expected = null; // TODO: Initialize to an appropriate value
            IEnumerator actual;
            actual = target.GetEnumerator();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        [DeploymentItem("Algorithms.exe")]
        public void GetEnumeratorTest1()
        {
            GetEnumeratorTest1Helper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for ToString
        ///</summary>
        public void ToStringTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            string expected = string.Empty; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.ToString();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void ToStringTest()
        {
            ToStringTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for UnlinkNode
        ///</summary>
        public void UnlinkNodeTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree_Accessor<T> target = new TwoThreeTree_Accessor<T>(); // TODO: Initialize to an appropriate value
            Node<T> node = null; // TODO: Initialize to an appropriate value
            target.UnlinkNode(node);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        [DeploymentItem("Algorithms.exe")]
        public void UnlinkNodeTest()
        {
            UnlinkNodeTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Count
        ///</summary>
        public void CountTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            int actual;
            actual = target.Count;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void CountTest()
        {
            CountTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for IsReadOnly
        ///</summary>
        public void IsReadOnlyTestHelper<T>()
            where T : IComparable
        {
            TwoThreeTree<T> target = new TwoThreeTree<T>(); // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.IsReadOnly;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void IsReadOnlyTest()
        {
            IsReadOnlyTestHelper<GenericParameterHelper>();
        }
    }
}
